import Vue from 'vue'  // vue
import App from './App.vue' // 组件入口
import store from './store' // vuex 全局变量
import router from './router/router' // 路由
import ElementUI from 'element-ui' // element
import VueCookies from 'vue-cookies'  // cookie
import MintUI from 'mint-ui' // mint
import VueI18n from 'vue-i18n' // i18n
import eth_util from './assets/js/eth_util'
import tool_eth_util from './assets/js/tool_eth_util'

// 公共 css
import 'mint-ui/lib/style.css'
import 'element-ui/lib/theme-chalk/reset.css'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/css/reset.css'
import './assets/css/border.css'
import './assets/css/style.css'

// 公共 js
import common from './assets/js/common'
import requestAxios from './assets/js/axios'
import md5 from "js-md5" // md5

Vue.prototype.$md5 = md5;
Vue.prototype.common = common;
Vue.prototype.eth_util = eth_util;
Vue.prototype.tool_eth_util = tool_eth_util;
Vue.prototype.requestAxios = requestAxios;


// 全局引用中间件
Vue.use(VueCookies);
Vue.use(ElementUI);
Vue.use(MintUI);
Vue.use(VueI18n);

const i18n = new VueI18n({
    locale: 'zh-CN',    // 语言标识
    //this.$i18n.locale // 通过切换locale的值来实现语言切换
    messages: {
        'zh-CN': require('./assets/lang/zh'),   // 中文语言包
        'en-US': require('./assets/lang/en')    // 英文语言包
    }
})


Vue.config.productionTip = false;

new Vue({
    i18n,
    store,
    router,
    render: h => h(App),
}).$mount('#app');
